package 
{
	import flash.display.Sprite;
	import flash.events.Event;
	
	/**
	 * @author Alejandro
	 */
	
	import flash.display.GradientType; 
	import flash.display.Sprite; 
	import flash.geom.Matrix; 

	public class Main extends Sprite 
	{
		
		public function Main():void 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			var oval:Sprite = new Sprite(); 
			// Draw a gradient oval. 
			var colors:Array = [0x00FF00, 0x00FF00]; 
			var alphas:Array = [1, 0]; 
			var ratios:Array = [0, 255]; 
			var matrix:Matrix = new Matrix(); 
			matrix.createGradientBox(150, 100, 0, -100, -50); 
			oval.graphics.beginGradientFill(GradientType.RADIAL, 
											colors, 
											alphas, 
											ratios, 
											matrix); 
			oval.graphics.drawEllipse(-100, -50, 200, 100); 
			oval.graphics.endFill(); 
			// add the Sprite to the display list 
			this.addChild(oval); 
		}
		
	}
	
}